import type { UploadChangeParam } from "ant-design-vue";
import { message, Modal } from "ant-design-vue";
const baseUrl = import.meta.env.VITE_API_URL;
export const uploadPath = baseUrl + "/oss/file/upload";
export const handleFileChange = (
  info: UploadChangeParam,
  calback?: Function
) => {
  if (info.file.status !== "uploading") {
    // console.log(info.file, info.fileList);
  }
  if (info.file.status === "done") {
    const url = info.file.response.data;
    // console.log(fileList);
    if (calback) calback(url);
  } else if (info.file.status === "error") {
    message.error("上传失败");
    // message.error(`${info.file.name} file upload failed.`);
  }
};
